import os

import launch_ros.actions
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription


def generate_launch_description():

    robot_state_publisher = launch_ros.actions.Node(
        package='robot_state_publisher',
        executable='robot_state_publisher',
        name='robot_state_publisher_mini_akm',
        arguments=[os.path.join(get_package_share_directory(
            'bichon_urdf'), 'urdf', 'mini_akm_robot.urdf')]
    )

    base_link_node = launch_ros.actions.Node(
        package='tf2_ros',
        executable='static_transform_publisher',
        name='base_footprint_to_base_link',
        arguments=[
                '--x', '0',
                '--y', '0',
                '--z', '0',
                '--roll', '0',
                '--pitch', '0',
                '--yaw', '0',
                '--frame-id', 'base_footprint',
                '--child-frame-id', 'base_link'
        ]
    )

    ld = LaunchDescription()
    ld.add_action(robot_state_publisher)
    ld.add_action(base_link_node)
    return ld
